﻿import sys
import clr
clr.AddReference('Newtonsoft.Json.Net20')
from Newtonsoft.Json import *
from Newtonsoft.Json.Linq import *

def GetDestQueuePathByMessage(message):
    try:
        jObject = JObject.Parse(message.Label)
    except : 
        return defaultQueueAddress
    
    if jObject is None or jObject["Machine"] is None:
        return defaultQueueAddress
    machine = clr.Convert(jObject["Machine"], type.GetType(""))	    
    machine = machine.ToLower()
    if machine in otherBaseSet:
        return otherQueueAddress
    return defaultQueueAddress